'use strict';

const Controller = require('egg').Controller;

class BackController extends Controller {

     async getQuestionByType(ctx) {
        let type = ctx.query.type
         let start = ctx.query.start
        var information = await ctx.service.back.getQuestionByType(type,start)
        ctx.body = information
    }


    async addQuestion(ctx) {

        let form = ctx.request.body.form
        let dynamicTags = ctx.request.body.dynamicTags
        var information = await ctx.service.back.addQuestion(form, dynamicTags)
        ctx.body = information
    }

  async deleteQuestion(ctx) {

        let id = ctx.query.id
        var information = await ctx.service.back.deleteQuestion(id)
        ctx.body = information
    }
}

module.exports = BackController;
